/** * @license * Copyright 2018 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { Oas20Parameter, Oas30Parameter, SimplifiedParameterType } from "apicurio-data-models"; import { EntityEditor, EntityEditorEvent, IEntityEditorHandler } from "./entity-editor.component"; import { DropDownOption } from "../../../../../../components/common/drop-down.component"; export interface ParameterData { name: string; description: string; type: SimplifiedParameterType; } export interface ParameterEditorEvent extends EntityEditorEvent { data: ParameterData; } export interface IParameterEditorHandler extends IEntityEditorHandler { onSave(event: ParameterEditorEvent): void; onCancel(event: ParameterEditorEvent): void; } export declare class ParameterEditorComponent extends EntityEditor { params: string[]; paramExists: boolean; model: ParameterData; _paramType: string; setParamType(paramType: string): void; doAfterOpen(): void; /** * Initializes the editor's data model from a provided entity (initialize the editor data model from an entity). * @param entity */ initializeModelFromEntity(entity: Oas20Parameter | Oas30Parameter): void; /** * Initializes the editor's data model to an empty state. */ initializeModel(): void; /** * Returns true if the data model is valid. */ isValid(): boolean; /** * Creates an entity event specific to this entity editor. */ entityEvent(): ParameterEditorEvent; /** * Gets the array of parameters for the current context. */ private getParams; isRequired(): boolean; required(): string; requiredOptions(): DropDownOption[]; type(): string; typeOptions(): DropDownOption[]; typeOf(): string; typeOfOptions(): DropDownOption[]; typeAs(): string; typeAsOptions(): DropDownOption[]; shouldShowEnumEditor(): boolean; shouldShowFormattedAs(): boolean; changeRequired(newValue: string): void; changeType(type: string): void; changeTypeEnum(value: string[]): void; changeTypeOf(typeOf: string): void; changeTypeAs(typeAs: string): void; heading(): string; private addRefTypes; }